<template>
  <div>
    <el-menu
      :default-active="$route.path"
      class="el-menu-demo menu"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      router
      active-text-color="#ffd04b">
      <el-menu-item :index="modulePath">
        {{moduleName}}
      </el-menu-item>
      <el-menu-item v-for="(item,index) in headerList" :index="item.path" :key="index">
        {{item.name}}
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
  import {mapState} from 'vuex'
    export default {
        name: "headers",
      data(){
          return {
            headerList: [{path: '/',name: '测试'},{path: '/login',name: '退出登录'}],
            moduleName: '模块',
          }
      },
      computed:{
        ...mapState({
          modulePath: (state)=>state.modulePath
        })
      },
      watch:{
      },
      methods: {
        handleSelect(key, keyPath) {
          console.log(key,keyPath);
        }
      }
    }
</script>

<style lang="scss" scoped>
  @import './../../assets/css/public/public';
  @import "./../../assets/css/index/index";
</style>
